from UIAutoTest.三层架构思想.FindElement import FindElement
import time
from selenium.webdriver.common.by import By


# 元素操作层
class ElementHandle(FindElement):
    def __init__(self):
        FindElement.__init__(self)

    def add_btn_h(self):
        btn = (By.XPATH, '//form[@class="form-validation-search"]/div[2]/a')
        self.click(btn)
        time.sleep(1)

    def user_name_h(self):
        self.user_name().send_keys('username')
        time.sleep(1)

    def phone_h(self):
        self.phone().send_keys('13838529341')
        time.sleep(1)

    def title_h(self):
        self.title().send_keys('good')
        time.sleep(1)

    def access_count_h(self):
        self.access_count().send_keys('i am a good boy')
        time.sleep(1)

    def count_h(self):
        self.count().send_keys('hahha')
        time.sleep(1)

    def reply_count_h(self):
        self.reply_count().send_keys('软件测试好')
        time.sleep(1)

    def is_reply_h(self):
        self.is_reply().click()
        time.sleep(1)

    def is_show_h(self):
        self.is_show().click()
        time.sleep(1)

    def sub_btn_h(self):
        self.sub_btn().click()
        time.sleep(1)
